﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using PSE.Framework.Versions.Engine;
using PSE.Framework.Versions.Common.Gateway;
using PSE.Framework.Versions.Common.Entities;

namespace PSEComponents.Versions.Service
{
    [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    public class DiscoveryVersions : IDiscoveryVersions
    {
        public Product Get(string productName, int majorVersion, string serverName)
        {
            try
            {
                LocalDiscovery localDiscovery = new LocalDiscovery();
                return localDiscovery.Get(productName, majorVersion, serverName);
            }
            catch (Exception ex)
            {
                throw new FaultException(new FaultReason(ex.ToString()), new FaultCode(ex.Message));
            }
        }
    }
}